import 'package:bi_project/model/home_mo.dart';
import 'package:bi_project/widget/hi_banner.dart';
import 'package:flutter/material.dart';

class HomeTabPage extends StatefulWidget {
  final String name;
  final List<BannerListMo>? bannerList;
  const HomeTabPage({super.key, required this.name, this.bannerList});

  @override
  State<HomeTabPage> createState() => _HomeTabPageState();
}

class _HomeTabPageState extends State<HomeTabPage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: ListView(
        children: [if (widget.bannerList != null) _banner(widget.bannerList!)],
      ),
    );
  }

  _banner(List<BannerListMo> bannerList) {
    return Padding(
      padding: const EdgeInsets.only(left: 8, right: 8),
      child: HiBanner(bannerList),
    );
  }
}
